
package py.com.erpone.entity.dm;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import py.com.erpone.entity.almacen.LoteDetalle;


@Entity
@NamedQueries(value={@NamedQuery(name="ubicacion.all",query="select p from Ubicacion p order by p.nombre")})
public class Ubicacion implements Serializable{

	private static final long serialVersionUID = 1L;


	@Id
	@GeneratedValue
	private Long id;

	@NotNull
	@Size(max=50)
	private String nombre;

	@OneToOne(fetch=FetchType.LAZY, mappedBy="sectorDivision")
	private LoteDetalle loteDetalle;
	
	@OneToOne
	@LazyCollection(LazyCollectionOption.FALSE)
	  @JoinColumn(name="sectorDivision_id")
	private SectorDivision division;
	
	

	public SectorDivision getDivision() {
		return division;
	}

	public void setDivision(SectorDivision division) {
		this.division = division;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	public LoteDetalle getLoteDetalle() {
		return loteDetalle;
	}

	public void setLoteDetalle(LoteDetalle loteDetalle) {
		this.loteDetalle = loteDetalle;
	}
	
	



}
